/**
 * @file slam_factory.cc
 * @author DustinKsi (dustinksi@126.com)
 * @brief
 * @version 0.1
 * @date 2019-12-22
 *
 * @copyright Copyright (c) 2019
 *
 */

#include "venus/slam/slam_factory.h"

#include "venus/slam/dustin_slam/dustin_slam.h"

namespace VEnus {

namespace SLAM {
void SLAMFactory::RegisterSLAMFactory() {
  Register(VEnus::SLAM::Dustin, []() -> AbstractSLAM * { return new DustinSLAM(); });
}

std::unique_ptr<AbstractSLAM> SLAMFactory::CreateSLAM(const SLAMOptions& options) {
  auto abstract_factory = CreateObject(options.brand());
  if (!abstract_factory) {
    D_ERROR << "SLAMFactory failed to create instance";
  } else {
    abstract_factory->SetMappingOptions(options);
    //  CLASS_LOG(MappingFactory) << " successfully created instance";
  }
  return abstract_factory;
}
}
}